package com.sg.dto.integration.component;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc MessagePositionDto
 * @使用场景
 */
@Data
public class MessagePositionDto extends BaseDto implements Serializable {

    /**
     * 消息位置ID
     */
    @ApiModelProperty("消息位置ID")
    private String messageLocationId;

    /**
     * 位置标识
     */
    @ApiModelProperty("位置标识")
    private String locationCode;

    /**
     * 上级消息位置ID
     */
    @ApiModelProperty("上级消息位置ID")
    private String superiorMessageLocationId;

    /**
     * 消息位置标识
     */
    @ApiModelProperty("消息位置标识")
    private String messageLocationCode;

    /**
     * 消息使用子场景类型编码
     */
    @ApiModelProperty("消息使用子场景类型编码")
    private String contentTypeCode;

    /**
     * 位置提醒类型
     */
    @ApiModelProperty("位置提醒类型")
    private String remindTypeCode;

    /**
     * 通道类型编码 MESSAGE_ASSISTANT:消息助手 PERSONAL_SESSION:个人会话 GROUP_SESSION:群会话
     */
    @ApiModelProperty("通道类型编码")
    private String messageChannelTypeCode;

    /**
     * 层级
     */
    @ApiModelProperty("层级")
    private Long stratum;

    /**
     * 主体生命周期 CURRENTLY_VALID:当前有效 EDITING:正在编辑 ARCHIVING:历史存档
     */
    @ApiModelProperty("主体生命周期")
    private String subjectLifeCycle;

    /**
     * 操作人就职记录ID
     */
    @ApiModelProperty("操作人就职记录ID")
    private String operationInductionId;

    /**
     * 操作时间
     */
    @ApiModelProperty("操作时间")
    private Date operateTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        MessagePositionDto that = (MessagePositionDto) o;
        return (
                messageLocationId == that.messageLocationId &&
                        locationCode == that.locationCode &&
                        superiorMessageLocationId == that.superiorMessageLocationId &&
                        messageLocationCode == that.messageLocationCode &&
                        contentTypeCode == that.contentTypeCode &&
                        remindTypeCode == that.remindTypeCode &&
                        messageChannelTypeCode == that.messageChannelTypeCode &&
                        stratum == that.stratum &&
                        subjectLifeCycle == that.subjectLifeCycle &&
                        operationInductionId == that.operationInductionId &&
                        operateTime == that.operateTime
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                messageLocationId,
                locationCode,
                superiorMessageLocationId,
                messageLocationCode,
                contentTypeCode,
                remindTypeCode,
                messageChannelTypeCode,
                stratum,
                subjectLifeCycle,
                operationInductionId,
                operateTime
        );
    }

}
